var bytes = Convert.FromBase64String(base64encodedstring); var contents = new StreamContent(new MemoryStream(bytes)); // Whatever else needs to be done here.